package com.ruoyi.firefighterTrainingTable.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.firefighterTrainingTable.domain.FirefighterTrainingTable;
import com.ruoyi.firefighterTrainingTable.service.IFirefighterTrainingTableService;
import com.ruoyi.ifmEnlistIand.mapper.FirefighterTrainingTableMapper;
import com.ruoyi.screeningDate.domain.Performance;
import com.ruoyi.screeningDate.domain.PerformanceT;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 体能科目训练登记Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class FirefighterTrainingTableServiceImpl implements IFirefighterTrainingTableService
{
    @Autowired
    private FirefighterTrainingTableMapper firefighterTrainingTableMapper;

    /**
     * 查询体能科目训练登记
     *
     * @param id 体能科目训练登记主键
     * @return 体能科目训练登记
     */
    @Override
    public FirefighterTrainingTable selectFirefighterTrainingTableById(Long id)
    {
        return firefighterTrainingTableMapper.selectFirefighterTrainingTableById(id);
    }

    /**
     * 查询体能科目训练登记列表
     *
     * @param firefighterTrainingTable 体能科目训练登记
     * @return 体能科目训练登记
     */
    @Override
    public List<FirefighterTrainingTable> selectFirefighterTrainingTableList(FirefighterTrainingTable firefighterTrainingTable)
    {
        return firefighterTrainingTableMapper.selectFirefighterTrainingTableList(firefighterTrainingTable);
    }

    /**
     * 新增体能科目训练登记
     *
     * @param firefighterTrainingTable 体能科目训练登记
     * @return 结果
     */
    @Override
    public int insertFirefighterTrainingTable(FirefighterTrainingTable firefighterTrainingTable)
    {
        firefighterTrainingTable.setCreateTime(DateUtils.getNowDate());
        return firefighterTrainingTableMapper.insertFirefighterTrainingTable(firefighterTrainingTable);
    }

    /**
     * 修改体能科目训练登记
     *
     * @param firefighterTrainingTable 体能科目训练登记
     * @return 结果
     */
    @Override
    public int updateFirefighterTrainingTable(FirefighterTrainingTable firefighterTrainingTable)
    {
        firefighterTrainingTable.setUpdateTime(DateUtils.getNowDate());
        return firefighterTrainingTableMapper.updateFirefighterTrainingTable(firefighterTrainingTable);
    }

    /**
     * 批量删除体能科目训练登记
     *
     * @param ids 需要删除的体能科目训练登记主键
     * @return 结果
     */
    @Override
    public int deleteFirefighterTrainingTableByIds(Long[] ids)
    {
        return firefighterTrainingTableMapper.deleteFirefighterTrainingTableByIds(ids);
    }

    /**
     * 删除体能科目训练登记信息
     *
     * @param id 体能科目训练登记主键
     * @return 结果
     */
    @Override
    public int deleteFirefighterTrainingTableById(Long id)
    {
        return firefighterTrainingTableMapper.deleteFirefighterTrainingTableById(id);
    }

    @Override
    public List<FirefighterTrainingTable > selectByNameAndId(Performance performance) {
        return firefighterTrainingTableMapper.selectByNameAndId(performance);
    }
}
